

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Analysing Localisation Microscopy data &mdash; PYME 0.1 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="PYME 0.1 documentation" href="index.html" />
    <link rel="up" title="Data Analysis" href="Analysis.html" />
    <link rel="next" title="Analysing data not generated by PYMEAcquire" href="AnalysingForeignData.html" />
    <link rel="prev" title="DSView / dh5view - A general purpose image data viewer" href="dh5view.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="AnalysingForeignData.html" title="Analysing data not generated by PYMEAcquire"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="dh5view.html" title="DSView / dh5view - A general purpose image data viewer"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">PYME 0.1 documentation</a> &raquo;</li>
          <li><a href="Analysis.html" accesskey="U">Data Analysis</a> &raquo;</li>
<li><a href="http://lmsrv1/docwiki/docs/pyme-docs/LocalisationAnalysis.rst">Edit</a> &raquo;</li>
 

      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="analysing-localisation-microscopy-data">
<span id="localisationanalysis"></span><h1>Analysing Localisation Microscopy data<a class="headerlink" href="#analysing-localisation-microscopy-data" title="Permalink to this headline">¶</a></h1>
<div class="section" id="distributed-analysis-and-queues">
<h2>Distributed analysis and queues<a class="headerlink" href="#distributed-analysis-and-queues" title="Permalink to this headline">¶</a></h2>
<p>PYME has a distributed analysis model whereby a server process manages <em>Task Queues</em>
and distributes groups of frames to
multiple different worker processes. These can either all be on the same machine, or be distributed
across a network/cluster. These server and worker processes need to be running before starting the analysis. The <tt class="docutils literal"><span class="pre">launchWorkers.py</span></tt>
script simplifies this by starting the server and the same number of workers as there
are cores on the current machine. To communicate with each other the server and worker
processes use a package called Pyro, and a pyro nameserver needs to be running so workers and
servers can find each other. If there is no name server running on the local network, launchWorkers
starts one, but this is probably only suitable/robust if only one machine is being used
for analysis.</p>
<p>If you&#8217;re running the analysis on the data acquisition computer, and have a decent number of
cores available (we have 8),  better performance can be achieved by reserving a core for
each of the Acqusition and Server processes (ie limiting the number of workers to 6 in our
8 core case). This can be done by explicitly specifying the number of workers to launch as
an argument eg: <tt class="docutils literal"><span class="pre">launchWorkers</span> <span class="pre">6</span></tt>.</p>
<div class="section" id="distributing-over-multiple-computers">
<h3>Distributing over multiple computers<a class="headerlink" href="#distributing-over-multiple-computers" title="Permalink to this headline">¶</a></h3>
<p>Distributing the analysis over multiple computers (a small ad-hoc cluster) is now easy:</p>
<ul class="simple">
<li>Make sure a pyro nameserver is running somewhere on your network and that it is
bound to the external interface rather than localhost (see the <a class="reference external" href="http://packages.python.org/Pyro/5-nameserver.html">Pyro  documentation</a>). If you don&#8217;t explicity run a nameserver, the first copy of <tt class="docutils literal"><span class="pre">launchWorkers</span></tt> you start will run one for you. The caveat with this approach is that you shouldn&#8217;t close this copy while you (or anyone else on your network segment) is doing analyisis, even on other computers.</li>
<li>Run <tt class="docutils literal"><span class="pre">launchWorkers</span></tt> on each machine you want to use.</li>
</ul>
</div>
</div>
<div class="section" id="loading-data">
<h2>Loading data<a class="headerlink" href="#loading-data" title="Permalink to this headline">¶</a></h2>
<p>Once the server and worker processes are running, the data should be opened
using <a class="reference internal" href="dh5view.html#dh5view"><em>dh5view</em></a>. For data spooled to a <tt class="docutils literal"><span class="pre">.h5</span> <span class="pre">file</span></tt> this can be
performed as one would expect, by either specifying the filename on the command
line or by ascociating <tt class="docutils literal"><span class="pre">dh5view</span></tt> with <tt class="docutils literal"><span class="pre">.h5</span></tt> files. For data saved directly to
a queue, the easiest way is probably to click the <strong>Analyse</strong> button on the
Spooling panel in <a class="reference internal" href="PYMEAcquire.html#pymeacquire"><em>PYMEAcquire</em></a>. Many protocols will do this
automatically after a the intial pre-bleaching phase has been performed.</p>
<p>For data not originating from <em>PYMEAcquire</em> the process is a little more complex
(see <a class="reference internal" href="AnalysingForeignData.html#analysingforeigndata"><em>Analysing data not generated by PYMEAcquire</em></a>).</p>
</div>
<div class="section" id="analysis-settings">
<h2>Analysis settings<a class="headerlink" href="#analysis-settings" title="Permalink to this headline">¶</a></h2>
<p>With the data loaded in dh5view, one should see something like:</p>
<img alt="_images/dh5view_lm.png" src="_images/dh5view_lm.png" />
<p>The <strong>Analysis</strong> and <strong>Point Finding</strong> panes in the left hand panel control the
analysis settings. The settings are:</p>
<table border="1" class="docutils">
<colgroup>
<col width="21%" />
<col width="79%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Setting</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Threshold</td>
<td>The threshold for event detection. This is not a strict threshold, but
rather a scaling factor applied to a local threhold computed from the
estimated pixel SNR. Will generally not need to be altered (except for
some of the interpolation based fits)</td>
</tr>
<tr class="row-odd"><td>Type</td>
<td>The type of fit to perform</td>
</tr>
<tr class="row-even"><td>Interp</td>
<td>The type of interpolation to perform (only methods with <em>Interp</em> in
their name)</td>
</tr>
<tr class="row-odd"><td>Start at</td>
<td>The frame # should to start our analysis at</td>
</tr>
<tr class="row-even"><td>Background</td>
<td>What range of frames should be used for background estimation. Uses
python slice notation.</td>
</tr>
<tr class="row-odd"><td>Debounce r</td>
<td>The radius (in pixels) within which 2 events cannot be reliably
distinguished</td>
</tr>
<tr class="row-even"><td>Shifts</td>
<td>The shift field to use for chromatic shift correction (only methods with
<em>Splitter</em> in their name.</td>
</tr>
<tr class="row-odd"><td>PSF</td>
<td>The PSF measurement to use (only <em>Interp</em> methods</td>
</tr>
<tr class="row-even"><td>Estimate Drift</td>
<td>Whether to estimate drift using fiduciaries <strong>[BROKEN]</strong></td>
</tr>
<tr class="row-odd"><td>Subtract background</td>
<td>Should we subtract the background before fitting (rather than
just event detection)</td>
</tr>
</tbody>
</table>
<div class="section" id="fit-types">
<h3>Fit types<a class="headerlink" href="#fit-types" title="Permalink to this headline">¶</a></h3>
<p>PYME offers a number of different fit types, and is easily extensible to support more.
The current ones are, with the ones you&#8217;d usually want to use in bold:</p>
<table border="1" class="docutils">
<colgroup>
<col width="26%" />
<col width="74%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Type</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>ConfocCOIR</td>
<td>Determines a 3D COI from confocal/widefield data</td>
</tr>
<tr class="row-odd"><td>Gauss3DFitR</td>
<td>Fits a 3D gaussian to confocal/widefield data</td>
</tr>
<tr class="row-even"><td><strong>InterpFitR</strong></td>
<td>Fits an interpolated PSF to localisation Data (<strong>3D</strong>)</td>
</tr>
<tr class="row-odd"><td>LatFitCOIR</td>
<td>Determines the position of events by taking their centroid.
Fast but not as good as a proper fit.</td>
</tr>
<tr class="row-even"><td><strong>LatGaussFitFR</strong></td>
<td>Simple 2D gaussian fitting.</td>
</tr>
<tr class="row-odd"><td>LatObjFindFR</td>
<td>Just perform the object finding part of the fitting process</td>
</tr>
<tr class="row-even"><td>LatPSFFitR</td>
<td>Fits a symplified model of a widefield PSF (<strong>3D</strong>). Use
InterpFitR instead</td>
</tr>
<tr class="row-odd"><td>SplitterFitCOIR</td>
<td>Determines centroids when two channels are split onto
separate halves of the CCD</td>
</tr>
<tr class="row-even"><td>SplitterFitFR</td>
<td>Like LatGaussFitFR but for split data</td>
</tr>
<tr class="row-odd"><td><strong>SplitterFitInterpR</strong></td>
<td>Like InterpFitR but for split data (<strong>3D</strong>)</td>
</tr>
<tr class="row-even"><td><strong>SplitterFitQR</strong></td>
<td>Faster version of SplitterFitFR (ommits background parameters)</td>
</tr>
<tr class="row-odd"><td>SplitterObjFindR</td>
<td>Like LatObjFindFR, but for split data</td>
</tr>
<tr class="row-even"><td>SplitterShiftEstFR</td>
<td>Used for estimating shift fields</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="starting-the-fitting">
<h2>Starting the fitting<a class="headerlink" href="#starting-the-fitting" title="Permalink to this headline">¶</a></h2>
<div class="section" id="testing-the-object-detection">
<h3>Testing the object detection<a class="headerlink" href="#testing-the-object-detection" title="Permalink to this headline">¶</a></h3>
<p>Whilst the threhold factor is fairly robust, it is generally worth testing the
detection by clicking the <strong>Test</strong> button. This performs the object finding step
on a selection of frames spaced throughout the sequence. If this fails one should
check the <tt class="docutils literal"><span class="pre">Camera.ADOffset</span></tt> setting in the metadata (accessible through the <strong>Metadata</strong> tab)
to see if this is reasonable before attempting to tweak the detection threshold. (The <em>ADOffset</em> is estimated by
taking a number of dark frames before the acquisition starts, and can be fooled if
the room lights are on and/or the laser shutters are misbehaving). Metadata parameters
can be edited by right clicking the appropriate field in the Metadata tab.</p>
</div>
<div class="section" id="launching-the-analysis-tasks">
<h3>Launching the analysis tasks<a class="headerlink" href="#launching-the-analysis-tasks" title="Permalink to this headline">¶</a></h3>
<p>Once satisfied with the event detection, the analysis proper can be started by
clicking the <strong>Go</strong> button. The results will automatically be saved, either under the
<tt class="docutils literal"><span class="pre">PYMEDATADIR</span></tt> directory (if the environment variable was set earlier), or in a directory
called <tt class="docutils literal"><span class="pre">PYMEData</span></tt> in the users home directory (<tt class="docutils literal"><span class="pre">c:\\Users\\&lt;username&gt;\\</span></tt> under windows).</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Analysing Localisation Microscopy data</a><ul>
<li><a class="reference internal" href="#distributed-analysis-and-queues">Distributed analysis and queues</a><ul>
<li><a class="reference internal" href="#distributing-over-multiple-computers">Distributing over multiple computers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#loading-data">Loading data</a></li>
<li><a class="reference internal" href="#analysis-settings">Analysis settings</a><ul>
<li><a class="reference internal" href="#fit-types">Fit types</a></li>
</ul>
</li>
<li><a class="reference internal" href="#starting-the-fitting">Starting the fitting</a><ul>
<li><a class="reference internal" href="#testing-the-object-detection">Testing the object detection</a></li>
<li><a class="reference internal" href="#launching-the-analysis-tasks">Launching the analysis tasks</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="dh5view.html"
                        title="previous chapter">DSView / <tt class="docutils literal docutils literal"><span class="pre">dh5view</span></tt> - A general purpose image data viewer</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="AnalysingForeignData.html"
                        title="next chapter">Analysing data not generated by PYMEAcquire</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/LocalisationAnalysis.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="AnalysingForeignData.html" title="Analysing data not generated by PYMEAcquire"
             >next</a> |</li>
        <li class="right" >
          <a href="dh5view.html" title="DSView / dh5view - A general purpose image data viewer"
             >previous</a> |</li>
        <li><a href="index.html">PYME 0.1 documentation</a> &raquo;</li>
          <li><a href="Analysis.html" >Data Analysis</a> &raquo;</li>
<li><a href="http://lmsrv1/docwiki/docs/pyme-docs/LocalisationAnalysis.rst">Edit</a> &raquo;</li>
 

      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2010, David Baddeley.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>